package sns.service;

import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import sns.bean.Tag;
import sns.bean.User;
import sns.dao.TagDao;

@Transactional
public class TagService {
	
	private TagDao tagDao;

	/**
	 * get tag by its id
	 * 
	 * @param idtag
	 * @return
	 */
	public Tag getTagById(Long idtag){
		return tagDao.getTagById(idtag);
	}
	
	/**
	 * get tags of the user
	 * 
	 * @param user
	 * @return
	 */
	public List<Tag> getTagsOfUser(User user){
		return tagDao.getTagsOfUser(user);
	}
	
	public void setTagDao(TagDao tagDao) {
		this.tagDao = tagDao;
	}
	
}
